import { MockMethod } from 'vite-plugin-mock'
import { SUCCESS_CODE } from '@/constants'

const timeout = 1000

const adminList = [
  {
    path: '/task',
    component: '#',
    redirect: '/task/manage',
    name: 'task',
    meta: {
      title: '任务管理',
      icon: 'carbon:skill-level-advanced'
    },
    children: [
      {
        path: 'manage',
        name: 'task-manage',
        component: 'views/task/index',
        meta: {
          title: '任务管理'
        }
      }
    ]
  }
]

export default [
  // 列表接口
  {
    url: '/mock/role/list',
    method: 'get',
    timeout,
    response: ({ query }) => {
      return {
        code: SUCCESS_CODE,
        data: adminList
      }
    }
  }
] as MockMethod[]
